package com.it.asen;

import java.util.Scanner;

public class NewObject {
    public static void main(String[] args) {
        Student student = new Student("历史",15);
        System.out.println(student.getAge()+student.getName());


        Scanner scanner = new Scanner(System.in);
         int hao = scanner.nextInt();
        System.out.println("你输入一个数1：");
        String hao2 = scanner.nextLine();
        System.out.println("你输入一个数2：");
         String hao3 = scanner.next();



    }




}
class  Student{

    private String name;
    private int age;

    public  Student(){
        System.out.println("我是构造函数");
    }
    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("我是有参构造");
    }
    public String getName() {
        return name;
    }
    public int getAge() {
        return age;
    }
    public void setName(String name) {
        this.name = name;
    }
    public void setAge(int age) {
        this.age = age;
    }
}